<?php 
//引入头部和常用函数
include_once '../function.php';

//实例化msyqli类
$mysqli = @new mysqli("localhost", "root", "", "school"); 

if($mysqli->connect_errno){
	echo "数据链接失败：错误代码：".$mysqli->connect_errno."错误信息：".$mysqli->connect_error;
}


$mysqli->query("set names utf8");


$stmt = $mysqli->prepare("insert into stu (name,sex,age) values(?,?,?)");

if($stmt){

	$stmt->bind_param('ssi', $name, $sex,$age);

	$age =18;

	for ($i=0; $i <500 ; $i++) { 
		$name = "小明".$i;

		$sex = "男";

		$age += 1;

		$stmt->execute();
	}

}














// //释放结果集
// $res->free();

// //关闭链接
// $mysqli->close();






 ?>